package com.sunshine.androidjavapractise.ui.activity.rx;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.sunshine.androidjavapractise.R;

import io.reactivex.Observable;

public class RxActivity extends AppCompatActivity {
    private TextView mTvName;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rx);
        mTvName = (TextView) findViewById(R.id.tv_name);
        rxTest();
    }

    private void rxTest() {
        Observable.just("Hello RXJava").subscribe(s -> mTvName.setText(s));
    }
}
